package com.ccb.sc.common.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author Ken
 * @date 2020/7/15
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum AuditStatus implements IEnum<Integer> {

    /**
     * 审核状态
     */
    WAITAUDIT(1, "未审核"),
    AUDITED(2, "审核通过"),
    REFUSED(3, "已拒绝"),
    CANCELED(4, "已取消");

    private int value;
    private String desc;

    AuditStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static AuditStatus getByValue(int value) {
        for (AuditStatus auditStatus : AuditStatus.values()) {
            if (auditStatus.getValue() == value) {
                return auditStatus;
            }
        }
        return null;
    }
}
